package cn.com.maven.designpattern.simpleFactory;

/**
 * @Author YongQiang
 * @Date 2021/5/19 9:11
 * @Version 1.0
 */
public class SimpleFactory {

    public static Product createProduct(ProductEnum productId) {
        switch (productId) {
            case PRODUCTA:
                return new ProductA();
            case PRODUCTB:
                return new ProductB();
            default:
                return null;
        }
    }
}
